<?php
include_once("class.lib/db.class.php");
include_once("class.lib/user.class.php");
include_once("class.lib/personne.class.php");

$personne = new personne();
$user     = new User();

$details_personn = $user->getPersonne($_GET["userid"]);



while (list($clef,$valeur)=each($details_personn))
{  

 
 $motdepasse      = $valeur[7];
 $email           = $valeur[8];
 

?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Soumisison du cours</title>



<script language="JavaScript">
//PLF-http://www.jejavascript.net/
function OuvrirPop(url,nom,haut,Gauche,largeur,hauteur,options) {
ouvpop=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}
</script>
<script type="text/javascript" src="javascript.js"></script>
<link href="presse.css" rel="stylesheet" type="text/css" />

<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="scriptaculous/src/effects.js" type="text/javascript"></script>
<script type="text/javascript" src="fabtabulous.js"></script>
<script type="text/javascript" src="validation.js"></script>
</head>
<body bgcolor="DFE8F6">



<u>
<H1>&nbsp; </H1>
</u> 
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="DFE8F6">
    <tr> 
      <td align="left"> <p><strong><font color="DD0269">NB</font></strong>: Vous &ecirc;tes d&eacute;ja inscrit avec ce num&eacute;ro de CIN, si vous avez oubli&eacute; vos codes d'acc&egrave;s, veuillez saisir votre mail :<br />
        <br />
      </p>
      </td>
    </tr>
    <tr> 
      
    <td align="left">&nbsp; </td>
    </tr>
    <tr>
      <td> 
        <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr align="left"> 
          <td height="0" valign="top"><em><font color="#277BB0"><strong> </strong></font></em> 

        <form name="cours" id="cours" method="post" action="" >
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr align="left"> 
                  <td colspan="3"> <strong><img src="images/navi_arerow.gif" width="6" height="21" align="absmiddle" /> 
                    Tapez votre mail:</strong></td>
                </tr>
                <tr valign="top" bgcolor="#345491"> 
                  <td colspan="3"><img src="images/gif/pix.gif" width="1" height="1"></td>
                </tr> 
				
				<tr align="left"> 
                  <td height="25">Email:</td>
                  <td width="5" height="0">&nbsp;</td>
                  <td height="0"><input name="email" type="text" id="email"</td>
                </tr>
                
                
				                

               
                
                <tr> 
                  <td height="25" align="left">&nbsp;</td>
                  <td height="25">&nbsp;</td>
                  <td height="25" align="left"> 
				    
					<input type="hidden" name="send_params" value="OK">
					<input type="hidden" name="user_id" value="<? echo $_GET['userid']; ?>">
					<input type="hidden" name="valid_mail" value="<? echo $email; ?>">
					<input type="hidden" name="motdepasse" value="<? echo $motdepasse; ?>">
					
					<input type="reset" name="Submit22" value="R&eacute;tablir" class="button" /> 
                    <input type="submit" name="Submit3" value="valider" class="button" />
					
					
					                  </td>
                </tr>
              </table>
            </form>
       <script type="text/javascript">
		 var valid2 = new Validation('cours', {useTitles:true});
	  </script>
      </td>
    </tr>
    <tr>
	
      
    <td align="left">&nbsp;</td>
    </tr>
  </table>
  </td>
    </tr>
</table>

<? }
 if(!empty($_POST["send_params"]))
    {
	  
	 $ue_tab["email"]        =   $_POST["email"];
     $ue_tab["login"]        =   $_POST["user_id"];
	 $ue_tab["motdepasse"]   =   $_POST["motdepasse"];
	 
     
	 
	 if($_POST["valid_mail"] != $_POST["email"])
	 
	     echo " <strong><font color=\"DD0269\">Vous avez introduit un email inconvenable, veuillez verifier SVP </font></strong>";
	 else
	   {
	   	$objet   = "UVT | Vos parametres!"; 
		$message = "Ci joint vos parametres d'accès à l'application de soumission de cours \nl";
		
		$message.="Login:".$_POST["user_id"]."\nl";
		$message.="Mot de passe:".$_POST["motdepasse"]."\nl\nl\nl";
		
		$message.="Cordialement\nl Equipe pédagogique UVT";
		
		//mail($_POST["valid_mail"], $objet, $message);
		
		
		/* echo "<script language=\"JavaScript\"> document.location=\"http://test.uvt.rnu.tn/soumission_ens/\"; </script>;"; */
		
	   }
	 
	


	} 

  
?>

</body>
</html>
